package com.config;

import com.bean.Bean1;
import com.bean.Bean2;
import com.bean.ExcelDataSource;
import com.bean.RedisConnectionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {
    @Bean
    public Bean1 bean1(ExcelDataSource excelDataSource) {
        Bean1 bean1 = new Bean1();
        bean1.setExcelDataSource(excelDataSource);
        bean1.setRedisConnectionFactory(redisConnectionFactory());
        return bean1;
    }

    @Bean
    public Bean2 bean2() {
        return new Bean2();
    }

    @Bean
    public ExcelDataSource excelDataSource(){
        return new ExcelDataSource();
    }

    @Bean
    public RedisConnectionFactory redisConnectionFactory(){
        return new RedisConnectionFactory();
    }
}
